<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

	<title>Module: ApplicationHelper</title>

	<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

	<script src="./js/jquery.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/thickbox-compressed.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/quicksearch.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/darkfish.js" type="text/javascript"
		charset="utf-8"></script>

</head>
<body class="module">

	<div id="metadata">
		<div id="home-metadata">
			<div id="home-section" class="section">
        <h3 class="section-header">
          <a href="./index.html">Home</a>
          <a href="./index.html#classes">Classes</a>
          <a href="./index.html#methods">Methods</a>
        </h3>
			</div>
		</div>

		<div id="file-metadata">
			<div id="file-list-section" class="section">
				<h3 class="section-header">In Files</h3>
				<div class="section-body">
					<ul>
					
						<li><a href="./app/helpers/application_helper_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
							class="thickbox" title="app/helpers/application_helper.rb">app/helpers/application_helper.rb</a></li>
					
					</ul>
				</div>
			</div>

			
		</div>

		<div id="class-metadata">

			<!-- Parent Class -->
			

			<!-- Namespace Contents -->
			

			<!-- Method Quickref -->
			
			<div id="method-list-section" class="section">
				<h3 class="section-header">Methods</h3>
				<ul class="link-list">
					
					<li><a href="#method-i-event_calendar">#event_calendar</a></li>
					
					<li><a href="#method-i-event_calendar_opts">#event_calendar_opts</a></li>
					
					<li><a href="#method-i-format_tag_list">#format_tag_list</a></li>
					
					<li><a href="#method-i-get_avatar_image">#get_avatar_image</a></li>
					
					<li><a href="#method-i-label_for">#label_for</a></li>
					
					<li><a href="#method-i-logged_in%3F">#logged_in?</a></li>
					
					<li><a href="#method-i-month_link">#month_link</a></li>
					
					<li><a href="#method-i-select_options_from_array">#select_options_from_array</a></li>
					
					<li><a href="#method-i-text_format">#text_format</a></li>
					
					<li><a href="#method-i-time_format">#time_format</a></li>
					
					<li><a href="#method-i-view_attachment_file">#view_attachment_file</a></li>
					
					<li><a href="#method-i-will_paginate_mobile">#will_paginate_mobile</a></li>
					
				</ul>
			</div>
			

			<!-- Included Modules -->
			
			<div id="includes-section" class="section">
				<h3 class="section-header">Included Modules</h3>
				<ul class="link-list">
				
				
					<li><a class="include" href="CommonUtils.html">CommonUtils</a></li>
				
				
				
					<li><a class="include" href="Mobile/EmoticonHelper.html">Mobile::EmoticonHelper</a></li>
				
				
				</ul>
			</div>
			
		</div>

		<div id="project-metadata">
			
			
			<div id="fileindex-section" class="section project-section">
				<h3 class="section-header">Files</h3>
				<ul>
				
					<li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a></li>
				
				</ul>
			</div>
			

			<div id="classindex-section" class="section project-section">
				<h3 class="section-header">Class Index
					<span class="search-toggle"><img src="./images/find.png"
						height="16" width="16" alt="[+]"
						title="show/hide quicksearch" /></span></h3>
				<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
				<fieldset>
					<legend>Quicksearch</legend>
					<input type="text" name="quicksearch" value=""
						class="quicksearch-field" />
				</fieldset>
				</form>

				<ul class="link-list">
				
					<li><a href="./Portal.html">Portal</a></li>
				
					<li><a href="./Portal/FriendsController.html">Portal::FriendsController</a></li>
				
					<li><a href="./Portal/FriendsHelper.html">Portal::FriendsHelper</a></li>
				
					<li><a href="./Portal/MessageAttachmentsController.html">Portal::MessageAttachmentsController</a></li>
				
					<li><a href="./Portal/MessageAttachmentsHelper.html">Portal::MessageAttachmentsHelper</a></li>
				
					<li><a href="./Portal/MessageDestinationsController.html">Portal::MessageDestinationsController</a></li>
				
					<li><a href="./Portal/MessageDestinationsHelper.html">Portal::MessageDestinationsHelper</a></li>
				
					<li><a href="./Portal/MessageFoldersController.html">Portal::MessageFoldersController</a></li>
				
					<li><a href="./Portal/MessageFoldersHelper.html">Portal::MessageFoldersHelper</a></li>
				
					<li><a href="./Portal/MessageOutboxController.html">Portal::MessageOutboxController</a></li>
				
					<li><a href="./Portal/MessageOutboxHelper.html">Portal::MessageOutboxHelper</a></li>
				
					<li><a href="./Portal/MessageRulesController.html">Portal::MessageRulesController</a></li>
				
					<li><a href="./Portal/MessageRulesHelper.html">Portal::MessageRulesHelper</a></li>
				
					<li><a href="./Portal/MessagesController.html">Portal::MessagesController</a></li>
				
					<li><a href="./Portal/MessagesHelper.html">Portal::MessagesHelper</a></li>
				
					<li><a href="./Portal/ProfilesController.html">Portal::ProfilesController</a></li>
				
					<li><a href="./Portal/ProfilesHelper.html">Portal::ProfilesHelper</a></li>
				
					<li><a href="./Portal/TopController.html">Portal::TopController</a></li>
				
					<li><a href="./Portal/TopHelper.html">Portal::TopHelper</a></li>
				
					<li><a href="./Common.html">Common</a></li>
				
					<li><a href="./Common/InvitesController.html">Common::InvitesController</a></li>
				
					<li><a href="./Common/InvitesHelper.html">Common::InvitesHelper</a></li>
				
					<li><a href="./Common/SettingsController.html">Common::SettingsController</a></li>
				
					<li><a href="./Common/SettingsHelper.html">Common::SettingsHelper</a></li>
				
					<li><a href="./Common/UserSessionsController.html">Common::UserSessionsController</a></li>
				
					<li><a href="./Common/UserSessionsHelper.html">Common::UserSessionsHelper</a></li>
				
					<li><a href="./Common/UsersController.html">Common::UsersController</a></li>
				
					<li><a href="./Common/UsersHelper.html">Common::UsersHelper</a></li>
				
					<li><a href="./Admin.html">Admin</a></li>
				
					<li><a href="./Admin/AdminController.html">Admin::AdminController</a></li>
				
					<li><a href="./Admin/GlobalSettingsController.html">Admin::GlobalSettingsController</a></li>
				
					<li><a href="./Admin/GlobalSettingsHelper.html">Admin::GlobalSettingsHelper</a></li>
				
					<li><a href="./Admin/SystemMessagesController.html">Admin::SystemMessagesController</a></li>
				
					<li><a href="./Admin/SystemMessagesHelper.html">Admin::SystemMessagesHelper</a></li>
				
					<li><a href="./Admin/UsersController.html">Admin::UsersController</a></li>
				
					<li><a href="./Admin/UsersHelper.html">Admin::UsersHelper</a></li>
				
					<li><a href="./Mobile.html">Mobile</a></li>
				
					<li><a href="./Mobile/EmoticonHelper.html">Mobile::EmoticonHelper</a></li>
				
					<li><a href="./Mobile/LinkRenderer.html">Mobile::LinkRenderer</a></li>
				
					<li><a href="./ApplicationController.html">ApplicationController</a></li>
				
					<li><a href="./ApplicationHelper.html">ApplicationHelper</a></li>
				
					<li><a href="./AvatarUploader.html">AvatarUploader</a></li>
				
					<li><a href="./BlogAttachmentUploader.html">BlogAttachmentUploader</a></li>
				
					<li><a href="./BoardMessageAttachmentUploader.html">BoardMessageAttachmentUploader</a></li>
				
					<li><a href="./CarrierWaveExtension.html">CarrierWaveExtension</a></li>
				
					<li><a href="./CommonUtils.html">CommonUtils</a></li>
				
					<li><a href="./CommunityAvatarUploader.html">CommunityAvatarUploader</a></li>
				
					<li><a href="./Friend.html">Friend</a></li>
				
					<li><a href="./FriendRequest.html">FriendRequest</a></li>
				
					<li><a href="./GlobalSetting.html">GlobalSetting</a></li>
				
					<li><a href="./Invite.html">Invite</a></li>
				
					<li><a href="./Message.html">Message</a></li>
				
					<li><a href="./MessageAttachment.html">MessageAttachment</a></li>
				
					<li><a href="./MessageAttachmentUploader.html">MessageAttachmentUploader</a></li>
				
					<li><a href="./MessageFolder.html">MessageFolder</a></li>
				
					<li><a href="./MessageRecipient.html">MessageRecipient</a></li>
				
					<li><a href="./MessageRule.html">MessageRule</a></li>
				
					<li><a href="./Profile.html">Profile</a></li>
				
					<li><a href="./Role.html">Role</a></li>
				
					<li><a href="./Setting.html">Setting</a></li>
				
					<li><a href="./SnsMailer.html">SnsMailer</a></li>
				
					<li><a href="./SystemMessage.html">SystemMessage</a></li>
				
					<li><a href="./User.html">User</a></li>
				
					<li><a href="./UserSession.html">UserSession</a></li>
				
				</ul>
				<div id="no-class-search-results" style="display: none;">No matching classes.</div>
			</div>

			
		</div>
	</div>

	<div id="documentation">
		<h1 class="module">ApplicationHelper</h1>

		<div id="description">
			<h3>システム全体の共通ヘルパーモジュール</h3>

		</div>

		<!-- Constants -->
		

		<!-- Attributes -->
		

		<!-- Methods -->
		
		<div id="public-instance-method-details" class="method-section section">
			<h3 class="section-header">Public Instance Methods</h3>

		
			<div id="event-calendar-method" class="method-detail ">
				<a name="method-i-event_calendar"></a>

				<div class="method-heading">
				
					<span class="method-name">event_calendar</span><span
						class="method-args">(width = 800, height = 600)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>イベントカレンダーを指定サイズで返す</h3>
					

					
					<div class="method-source-code"
						id="event-calendar-source">
<pre>
     <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 111</span>
111:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">event_calendar</span>(<span class="ruby-identifier">width</span> = <span class="ruby-value">800</span>, <span class="ruby-identifier">height</span> = <span class="ruby-value">600</span>)
112:     <span class="ruby-comment cmt"># args is an argument hash containing :event, :day, and :options</span>
113:     <span class="ruby-identifier">calendar</span> <span class="ruby-identifier">event_calendar_opts</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
114:       <span class="ruby-identifier">event</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:event</span>]
115:       <span class="ruby-node">%(&lt;a href=&quot;/event/schedules/#{event.id}show&quot; title=&quot;#{h(event.name)}&quot;&gt;#{h(event.name)}&lt;/a&gt;)</span>
116:     <span class="ruby-keyword kw">end</span>
117:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="event-calendar-opts-method" class="method-detail ">
				<a name="method-i-event_calendar_opts"></a>

				<div class="method-heading">
				
					<span class="method-name">event_calendar_opts</span><span
						class="method-args">(width, height)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>イベントカレンダーのデフォルトオプションをハッシュ形式で返す</h3>
					

					
					<div class="method-source-code"
						id="event-calendar-opts-source">
<pre>
     <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 96</span>
 96:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">event_calendar_opts</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
 97:     { 
 98:       <span class="ruby-value">:year</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@year</span>,
 99:       <span class="ruby-value">:month</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@month</span>,
100:       <span class="ruby-value">:width</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">width</span>,
101:       <span class="ruby-value">:height</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">height</span>,
102:       <span class="ruby-value">:event_strips</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@event_strips</span>,
103:       <span class="ruby-value">:link_to_day_action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;new&quot;</span>,
104:       <span class="ruby-value">:use_all_day</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>,
105:       <span class="ruby-value">:month_name_text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">localize</span>(<span class="ruby-ivar">@shown_month</span>, <span class="ruby-value">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;%B %Y&quot;</span>),
106:       <span class="ruby-value">:previous_month_text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;&lt;&lt; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">month_link</span>(<span class="ruby-ivar">@shown_month</span>.<span class="ruby-identifier">prev_month</span>),
107:       <span class="ruby-value">:next_month_text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">month_link</span>(<span class="ruby-ivar">@shown_month</span>.<span class="ruby-identifier">next_month</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; &gt;&gt;&quot;</span>    }
108:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="format-tag-list-method" class="method-detail ">
				<a name="method-i-format_tag_list"></a>

				<div class="method-heading">
				
					<span class="method-name">format_tag_list</span><span
						class="method-args">(list)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>クラウドタグの連結</h3>
<p>
クラウドタグを連結して文字列形式で返す。 現状、単純に配列をカンマでjoinしただけだが、将来的に変更するかも知れない のでヘルパー化してある。
</p>
					

					
					<div class="method-source-code"
						id="format-tag-list-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 53</span>
53:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format_tag_list</span>(<span class="ruby-identifier">list</span>)
54:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;, &quot;</span>)
55:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="get-avatar-image-method" class="method-detail ">
				<a name="method-i-get_avatar_image"></a>

				<div class="method-heading">
				
					<span class="method-name">get_avatar_image</span><span
						class="method-args">(obj, column_name = :avatar)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>ユーザーのアバター画像を表示するIMAGEタグ取得</h3>
<p>
文字列としてIMAGEタグを返す。
</p>
					

					
					<div class="method-source-code"
						id="get-avatar-image-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 59</span>
59:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_avatar_image</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">column_name</span> = <span class="ruby-value">:avatar</span>)
60:     <span class="ruby-identifier">avatar_url</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">column_name</span>.<span class="ruby-identifier">to_sym</span>).<span class="ruby-identifier">url</span>
61:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">avatar_url</span>
62:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">image_tag</span> <span class="ruby-identifier">avatar_url</span>
63:     <span class="ruby-keyword kw">else</span>
64:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">image_tag</span> <span class="ruby-value str">&quot;default_avatar.png&quot;</span>
65:     <span class="ruby-keyword kw">end</span>
66:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="label-for-method" class="method-detail ">
				<a name="method-i-label_for"></a>

				<div class="method-heading">
				
					<span class="method-name">label_for</span><span
						class="method-args">(label, obj, name, label_class = 'label')</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>HTMLラベルを返す</h3>
					

					
					<div class="method-source-code"
						id="label-for-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 82</span>
82:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">label_for</span>(<span class="ruby-identifier">label</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">label_class</span> = <span class="ruby-value str">'label'</span>)
83:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">errors</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>]
84:       <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;&lt;div class='fieldWithErrors'&gt;\n&lt;label class='#{label_class}'&gt;#{h(label)}&lt;/label&gt;\n&lt;span class='error'&gt;#{h(obj.errors[name.to_sym].first)}&lt;/span&gt;&lt;/div&gt;\n&quot;</span>.<span class="ruby-identifier">html_safe</span>
85:     <span class="ruby-keyword kw">else</span>
86:       <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;&lt;label class='label'&gt;#{h(label)}&lt;/label&gt;\n&quot;</span>.<span class="ruby-identifier">html_safe</span>
87:     <span class="ruby-keyword kw">end</span>
88:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="logged-in--method" class="method-detail ">
				<a name="method-i-logged_in%3F"></a>

				<div class="method-heading">
				
					<span class="method-name">logged_in?</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>ログイン中かどうかを真偽値で返す</h3>
<p>
ログイン済みであればtrue、違ったらfalse
</p>
					

					
					<div class="method-source-code"
						id="logged-in--source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 10</span>
10:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logged_in?</span>
11:     <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-ivar">@user</span>
12:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="month-link-method" class="method-detail ">
				<a name="method-i-month_link"></a>

				<div class="method-heading">
				
					<span class="method-name">month_link</span><span
						class="method-args">(month_date)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>月を表す文字をリンク化したAタグを返す</h3>
					

					
					<div class="method-source-code"
						id="month-link-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 91</span>
91:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">month_link</span>(<span class="ruby-identifier">month_date</span>)
92:     <span class="ruby-identifier">link_to</span>(<span class="ruby-constant">I18n</span>.<span class="ruby-identifier">localize</span>(<span class="ruby-identifier">month_date</span>, <span class="ruby-value">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;%B&quot;</span>), {<span class="ruby-value">:month</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">month_date</span>.<span class="ruby-identifier">month</span>, <span class="ruby-value">:year</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">month_date</span>.<span class="ruby-identifier">year</span>})
93:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="select-options-from-array-method" class="method-detail ">
				<a name="method-i-select_options_from_array"></a>

				<div class="method-heading">
				
					<span class="method-name">select_options_from_array</span><span
						class="method-args">(ary, selected_str = "")</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>SELECTタグのオプション生成を行う</h3>
<p>
TODO: これはRails標準で同じ機能があった。いつか本機能は抹殺すること。
</p>
					

					
					<div class="method-source-code"
						id="select-options-from-array-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 39</span>
39:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select_options_from_array</span>(<span class="ruby-identifier">ary</span>, <span class="ruby-identifier">selected_str</span> = <span class="ruby-value str">&quot;&quot;</span>)
40:     <span class="ruby-identifier">result</span> = <span class="ruby-value str">&quot;&quot;</span>
41:     <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pair</span><span class="ruby-operator">|</span>
42:       <span class="ruby-identifier">selected</span> = <span class="ruby-value str">&quot;&quot;</span>
43:       <span class="ruby-identifier">selected</span> = <span class="ruby-value str">&quot;selected&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pair</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">selected_str</span>
44:       <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;&lt;option #{selected} value='#{h(pair[1])}'&gt;#{h(pair[0])}&lt;/option&gt;\n&quot;</span>
45:     <span class="ruby-keyword kw">end</span>
46:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">html_safe</span>
47:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="text-format-method" class="method-detail ">
				<a name="method-i-text_format"></a>

				<div class="method-heading">
				
					<span class="method-name">text_format</span><span
						class="method-args">(text, format = "markdown")</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>メッセージなどの本文表示形式選択</h3>
<p>
第一引数で与えられた文字列を、第二引数で与えられるフォーマット形式の文字列 とみなして、整形結果を返す。 デフォルトはマークダウン形式。
</p>
					

					
					<div class="method-source-code"
						id="text-format-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 26</span>
26:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_format</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">format</span> = <span class="ruby-value str">&quot;markdown&quot;</span>)
27:     <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">to_s</span>
28:     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;plain&quot;</span>
29:       <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;&lt;pre&gt;#{h(text)}&lt;/pre&gt;&quot;</span>.<span class="ruby-identifier">html_safe</span>
30:     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;textile&quot;</span>
31:       <span class="ruby-keyword kw">return</span> <span class="ruby-constant">RedCloth</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">text</span>, [<span class="ruby-value">:filter_html</span>]).<span class="ruby-identifier">to_html</span>.<span class="ruby-identifier">html_safe</span>
32:     <span class="ruby-keyword kw">else</span>  <span class="ruby-comment cmt"># markdown</span>
33:       <span class="ruby-keyword kw">return</span> <span class="ruby-constant">BlueCloth</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">text</span>, [<span class="ruby-value">:filter_html</span>]).<span class="ruby-identifier">to_html</span>.<span class="ruby-identifier">html_safe</span>
34:     <span class="ruby-keyword kw">end</span>
35:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="time-format-method" class="method-detail ">
				<a name="method-i-time_format"></a>

				<div class="method-heading">
				
					<span class="method-name">time_format</span><span
						class="method-args">(time, format = nil)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>Timeオブジェクトのフォーマット定義</h3>
<p>
デフォルトのフォーマットを定義すると共に、任意のフォーマットも受け付ける TODO: デフォルトが日付しか扱わないのに<a
href="ApplicationHelper.html#method-i-time_format">time_format</a>とはこれいかに。
</p>
					

					
					<div class="method-source-code"
						id="time-format-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 17</span>
17:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_format</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>)
18:     <span class="ruby-identifier">format</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;%Y-%m-%d&quot;</span>
19:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">format</span>)
20:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="view-attachment-file-method" class="method-detail ">
				<a name="method-i-view_attachment_file"></a>

				<div class="method-heading">
				
					<span class="method-name">view_attachment_file</span><span
						class="method-args">(attachment, url, thumb_url = nil)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>メッセージやブログなどの添付ファイルが画像だった場合それを表示できる</h3>
<p>
IMAGEタグを返す TODO: サムネイルを返すよう修正しよう。
</p>
					

					
					<div class="method-source-code"
						id="view-attachment-file-source">
<pre>
    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 71</span>
71:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">view_attachment_file</span>(<span class="ruby-identifier">attachment</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">thumb_url</span> = <span class="ruby-keyword kw">nil</span>)
72:     <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">content_type</span>
73:     <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\Aimage\/.*\Z/</span>
74:       <span class="ruby-identifier">thumb_url</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">url</span>
75:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">link_to</span>(<span class="ruby-identifier">image_tag</span>(<span class="ruby-identifier">thumb_url</span>), <span class="ruby-identifier">url</span>)
76:     <span class="ruby-keyword kw">else</span>
77:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">link_to</span>(<span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">url</span>)
78:     <span class="ruby-keyword kw">end</span>
79:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="will-paginate-mobile-method" class="method-detail ">
				<a name="method-i-will_paginate_mobile"></a>

				<div class="method-heading">
				
					<span class="method-name">will_paginate_mobile</span><span
						class="method-args">(collection = nil, options = {})</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>携帯端末用のページネーションメソッド</h3>
					

					
					<div class="method-source-code"
						id="will-paginate-mobile-source">
<pre>
     <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 120</span>
120:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">will_paginate_mobile</span>(<span class="ruby-identifier">collection</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
121:     <span class="ruby-identifier">will_paginate</span>(<span class="ruby-identifier">collection</span>,
122:                   <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-value">:next_label</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;[#{emoticon_6}次へ]&quot;</span>,
123:                                 <span class="ruby-value">:previous_label</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;[#{emoticon_4}前へ]&quot;</span>,
124:                                 <span class="ruby-value">:renderer</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Mobile::LinkRenderer'</span>
125:                                ))
126:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
		</div>
	

	</div>


	<div id="rdoc-debugging-section-dump" class="debugging-section">
	
		<p>Disabled; run with --debug to generate this.</p>
	
	</div>

	<div id="validator-badges">
		<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
		<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
			Rdoc Generator</a> 1.1.6</small>.</p>
	</div>

</body>
</html>

